package main

import (
	"bytes"
	"fmt"
	"github.com/corona10/goimghdr"
	"io/ioutil"
	"os"
)

func main() {
	ret1, _ := goimghdr.What("1.tiff")
	fmt.Println(ret1)
	// 读取二进制
	f, _ := os.Open("1.tiff")
	defer f.Close()
	byteData, err := ioutil.ReadAll(f)
	if err!=nil{
		panic(err)
	}
	r := bytes.NewReader(byteData)
	ret2,_:=goimghdr.WhatFromReader(r)
	fmt.Println(ret2)
}
